$(function(){
	$(".screenbg ul li").each(function(){
		$(this).css("opacity","0");
	});
	$(".screenbg ul li:first").css("opacity","1");
	var index = 0;
	var t;
	var li = $(".screenbg ul li");	
	var number = li.size();
	function change(index){
            li.css("visibility","visible");
            li.eq(index).siblings().animate({opacity:0},3000);
            li.eq(index).animate({opacity:1},3000);
	}
	function show(){
		index = index + 1;
		if(index<=number-1){
			change(index);
		}else{
			index = 0;
			change(index);
		}
	}
	t = setInterval(show,8000);
	//根据窗口宽度生成图片宽度
	var width = $(window).width();
	$(".screenbg ul img").css("width",width+"px");
        
});
function check_login(){
    var name = $("#user_name").val();
    var pass = $("#user_pass").val();
    var code = $("#code").val();
    if($.trim(name) === '') {
        alert("请输入用戶名稱");
        $("#user_name").focus();
        return false;
    }
    if($.trim(pass) === '') {
        alert("请输入密碼");
        $("#user_pass").focus();
        return false;
    }
    if(typeof code !== 'undefined') {
        if($.trim(code) == '') {
            alert("请输入驗證碼");
            $("#code").focus();
            return false;
        }
    }
    return true;
}
